Jeff Kalikstein adds heart rate support for Forerunner 301.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 30 Aug 2005 17:38:17 +0000 (17:38 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 30 Aug 2005 17:38:17 +0000 (17:38 +0000)
gpsbabel/csv_util.c
gpsbabel/defs.h
gpsbabel/garmin.c
gpsbabel/style/README.style

index 5979486e35539f31225a30430a7eca60f506f543..e2ad5db8a5ceab604a7a5baa35877a6813098a64 100644 (file)
@@ -926,6 +926,9 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
     if ( strcmp( fmp->key, "PATH_DISTANCE_MILES") == 0) {
        /* Ignored on input */
     } else
+    if ( strcmp( fmp->key, "HEART_RATE") == 0) {
+      wpt->heartrate = atoi(s); 
+    }
     if ( strcmp( fmp->key, "PATH_DISTANCE_KM") == 0 ) {
        /* Ignored on input */
     } else {
@@ -1260,6 +1263,10 @@ xcsv_waypt_pr(const waypoint *wpt)
             writebuff( buff, fmp->printfc, wpt->course );
        } else
 
+        /* HEART RATE CONVERSION***********************************************/
+        if (strcmp(fmp->key, "HEART_RATE") == 0) {
+            writebuff(buff, fmp->printfc, wpt->heartrate);
+        } else
         /* TIME CONVERSIONS**************************************************/
         if (strcmp(fmp->key, "EXCEL_TIME") == 0) {
             /* creation time as an excel (double) time */
index c949a3177235cc7f0ac0330c2672b4ac6611f4a2..f1bb857033ed6fa8012c3a5feda843cda3eb6516 100644 (file)
@@ -289,7 +289,8 @@ typedef struct {
        float speed;    /* Optional: meters per second. */
        fix_type fix;   /* Optional: 3d, 2d, etc. */
        int  sat;       /* Optional: number of sats used for fix */
-       
+
+       int heartrate;   /* Beats per minute: likely to get moved to fs. */
        geocache_data gc_data;
        format_specific_data *fs;
        void *extra_data;       /* Extra data added by, say, a filter. */
index 75fc9e1fb8ab777aea00c9e3ef99bc46298d7c1c..8557ae1df10996eb41d809a43e89d6ad88909f1f 100644 (file)
@@ -287,6 +287,7 @@ track_read(void)
                wpt->longitude = array[i]->lon;
                wpt->latitude = array[i]->lat;
                wpt->altitude = array[i]->alt;
+               wpt->heartrate = array[i]->heartrate;
                wpt->shortname = xstrdup(array[i]->trk_ident);
                wpt->creation_time = array[i]->Time;
                
index b191b9bd1a1bfb1235d58539fb33f9e111e58b6b..f59ef1869e4eb5f878b98a8aa8a05f0f6f8e22e5 100644 (file)
@@ -327,6 +327,12 @@ The fields used by the XCSV parser are as follows:
    ALT_METERS is identical to ALT_FEET with the exception that the altitude
    is in METERS.
 
+ o HEART_RATE
+   Heart rate, measured in beats per minute.  Only valid for units with 
+   heart rate monitor features (i.e. Garmin Forerunner 301).
+
+   example: IFIELD HEART_RATE,"","%d"
+
  o EXCEL_TIME
    EXCEL_TIME is the waypoint's creation time, if any.  This is actually
    the decimal days since 1/1/1900 and is handled internally as a DOUBLE